<?php

if(isset($_POST['groupID'])){
	
	$doc = new DOMDocument();
	$doc->formatOutput = true;
	$doc->Load("groups.xml");
	
	$groups = $doc->documentElement;
	
	$b = $doc->createElement("grupo");
	$b->setAttribute("id", $_POST['groupID']);
	
	$permAsk = $doc->createElement("permissionAsk");
	$permAsk->appendChild(
			$doc->createTextNode(0)
	);
	$b->appendChild( $permAsk );
	//////////////////////////////////////
	$numAuth = $doc->createElement("numAuthorizations");
	$numAuth->appendChild(
			$doc->createTextNode(0)
	);
	$b->appendChild( $numAuth );
	/////////////////////////////////////
	$grant = $doc->createElement("accessGrant");
	$grant->appendChild(
			$doc->createTextNode(0)
	);
	$b->appendChild( $grant );
	/////////////////////////////////////
	$done = $doc->createElement("editionDone");
	$done->appendChild(
			$doc->createTextNode(0)
	);
	$b->appendChild( $done );
	
	
	$groups->appendChild( $b );
	
	$doc->save("groups.xml");
	
	echo 1;
}else{
	echo 0;
}

